Field of the Invention
The present invention relates to a communication apparatus, a communication method, and a non-transitory computer-readable storage medium.
Description of the Related Art
A plurality of connection methods are known in a wireless communication system. More specifically, there is a method (for example, an infrastructure mode) by which a communication apparatus performs wireless connection with a target apparatus via an access point. There is also a method (for example, a peer-to-peer mode, to be referred to as a P2P mode hereinafter) by which the communication apparatus or the target apparatus operates as an access point and directly performs wireless connection between them. Further, there is known a communication apparatus capable of simultaneously (in parallel) establishing connection with the target apparatus via an external apparatus such as an access point and direct connection with the target apparatus without going through the external apparatus. Note that an operation of establishing two types of connections simultaneously (in parallel) as described above will be referred to as a simultaneous operation.
Japanese Patent Laid-Open No. 2015-002426 discloses a technique of performing wireless communications with a target apparatus simultaneously in a P2P mode and an infrastructure mode, and a technique of deciding, in accordance with a protocol used in one of the respective modes, a protocol used in the other mode.
Under circumstances where the communication apparatus executes the simultaneous operation, when one communication connection is disconnected and reconnected, a behavior toward the other communication connection needs to be performed appropriately.
For example, the first communication protocol that needs to take a measure against a conflict of service names to be announced and the second communication protocol that does not need an anti-conflict measure are used for the above-described connection. Note that an example of the first communication protocol is Bonjour, and an example of the second communication protocol is Windows Service Discovery (to be referred to as WSD hereinafter). If the second communication protocol that does not need the anti-conflict measure is used for connection between the communication apparatus and the communication target apparatus, the communication target apparatus sends an inquiry packet to the communication apparatus each time a command is issued from the communication apparatus. That is, in order to suppress redundant reception of the inquiry packets in the communication apparatus, the communication apparatus should restrain itself from sending the commands to the communication target apparatus as much as possible when connected to the communication target apparatus by using the second communication protocol.